import {CUSTOMERS_REQUEST,CUSTOMERS_RECEIVE,CUSTOMERS_CLEAR,CUSTOMERS_CHANGE_DEPARTMENT} from "./actions"

import { createReducer } from 'redux-immutablejs'
import Immutable from 'Immutable'

const initialState = Immutable.fromJS({
  isFetching:true,
  isLastPage:false,
  items:[],
  query:{
    page:1,
    rows:10
  }})

export default createReducer(initialState,{
  [CUSTOMERS_REQUEST]:(state,action) => state.merge({
    isFetching:true
  }),
  [CUSTOMERS_RECEIVE]:(state,action) => state.merge({
    isFetching:false,
    items:action.items
  }),



})
